package cn.com.vastbase.hibernate.sample.springmvc.business.controller;

import cn.com.vastbase.hibernate.sample.springmvc.business.service.UserService;
import cn.com.vastbase.hibernate.sample.springmvc.business.service.impl.UserServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@RequestMapping("/")
@Controller
public class UserController {

    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @GetMapping("/user")
    @ResponseBody
    public String index() {
        try {
            return userService.doSomeThings("111");
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        }
    }

}
